package com.yuandian.business.monitor.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuandian.api.business_monitor.po.ComponentParams;
import com.yuandian.api.business_monitor.vo.ComponentDetailVo;
import com.yuandian.business.monitor.mapper.ComponentMapper;
import com.yuandian.business.monitor.service.IComponentService;
import com.yuandian.utils.PageDataInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 网端组件Service
 *
 * @Author wangpeiyang
 * @Date 2021/6/1 14:11
 */
@Service
@Slf4j
public class ConponentServiceImpl implements IComponentService {

	@Autowired
	private ComponentMapper componentMapper;

	/**
	 * 组件详情列表
	 *
	 * @param params
	 * @return
	 */
	@Override
	public PageDataInfo queryComponentDetailList(ComponentParams params) {


		//分页
		IPage<ComponentDetailVo> page = componentMapper.queryComponentDetailList(new Page<>(params.getPageNum(), params.getPageSize()), params);
		return new PageDataInfo(page);
	}

	@Override
	public List<ComponentDetailVo> queryComponentDetailListExport(ComponentParams params) {


		return componentMapper.queryComponentDetailListExport(params);
	}
}
